/**
 * @author lantian39999@163.com
 */

const local = location.origin;

chrome.action.onClicked.addListener(function (tab) {
    chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
        let data = {};
        data.local = local;
        data.cmd = "clickPupop";
        url = this.serviceWorker.scriptURL.replace("/background.js", "");
        data.url = url;
        console.log("back收到开关");
        chrome.tabs.sendMessage(tabs[0].id, { msg: data }, function (response) {
            console.log(response);
        });
    });
});
